package com.recruit.service;

import com.recruit.dao.CompanyLoginAndResgitDao;
import com.recruit.entity.CompanyUser;
import com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile;

import java.sql.SQLException;
/****
 * author:丁文彬
 * time：2020.9.25
 */
public class CompanyLoginAndRegistService {
    //dao层
    private CompanyLoginAndResgitDao companyLoginAndResgitDao = new CompanyLoginAndResgitDao();
    int index;
    CompanyUser companyUser = null;

    //企业用户登录
    public CompanyUser companyUserLogin(String username,String password){
        try {
            companyUser = companyLoginAndResgitDao.selectUserByUsernameAndPassword(username, password);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return companyUser;
    }

    //企业用户注册
    public int companyUserRegist(CompanyUser companyUser){
        try {
            index = companyLoginAndResgitDao.insertUser(companyUser);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return index;
    }

}
